package com.wallet.admin.feign.system;

import com.wallet.common.vo.PageResult;
import com.wallet.provider.model.SysUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("wallet-provider-sys")
public interface SysUserFeignClient {

    /**
     * 分页查询系统用户
     * @param keywords
     * @param pageNum
     * @param pageSize
     * @param orderName
     * @param orderType
     * @return
     */
    @RequestMapping(value = "/getSysUserList", method = RequestMethod.GET)
    PageResult<SysUser> getSysUserList(@RequestParam("keywords") String keywords, @RequestParam("pageNum") int pageNum, @RequestParam("pageSize") int pageSize, @RequestParam("orderName") String orderName, @RequestParam("orderType") String orderType);

    /**
     * 添加系统用户
     * @param sysUser
     * @return
     */
    @RequestMapping(value = "/addSysUser", method = RequestMethod.POST)
    boolean addSysUser(@RequestBody  SysUser sysUser);

    /**
     * 删除系统用户
     * @param ids
     * @return
     */
    @RequestMapping(value = "/deleteSysUser", method = RequestMethod.POST)
    boolean deleteSysUser(@RequestParam("ids") String ids);

    /**
     * 修改系统用户
     * @param sysUser
     */
    @RequestMapping(value = "/updateSysUser", method = RequestMethod.POST)
    boolean updateSysUser(@RequestBody  SysUser sysUser);

    /**
     * 验证登录名是否已存在
     * @param username
     * @return
     */
    @RequestMapping(value = "/validUserId", method = RequestMethod.POST)
    boolean validUserId(@RequestParam("username") String username);

    /**
     * 根据username根据系统用户
     * @param username
     * @return
     */
    @RequestMapping(value = "/getSysUserByUsername", method = RequestMethod.POST)
    SysUser getSysUserByUsername(@RequestParam("username") String username);

    /**
     * 根据id查询系统用户
     * @param id
     * @return
     */
    @RequestMapping(value = "/getSysUserById", method = RequestMethod.POST)
    SysUser getSysUserById(@RequestParam("id") Long id);
}
